﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;

namespace BaseUI
{
   public abstract class BaseWebPage<T> : System.Web.UI.Page
   {
      public BaseWebPage()
      {
         Activator.CreateInstance(typeof(T), new object[] { this });
      }

       //Это для локализации
       //выставляет начальное значение языка, на котором отображается страница
      protected override void InitializeCulture()
      {
          string culture = (string)Session["lang"];
          if (culture == null)
          {
              culture = "ru-Ru";
          }
          Culture = culture;
          System.Threading.Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(culture);
          System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo(culture);
          base.InitializeCulture();
      }
   }
}
